<?

echo "MODIFY MODE :" 	.$_SESSION["modify_mode"]. "<br/>\n";

if($_SESSION["modify_mode"] == "Y"){

	$status_of_write="Modify";
}else{

	$status_of_write="Confirm";
}

require("entry_header_html.php");
//query and get the table header

echo  "<table border='1' class='dedeq'>\n".
      "<th> NO      </th>\n".
      "<th> Model   </th>\n".
      "<th> Cvt     </th>\n".
      "<th> Cvt-Qty </th>\n".
      "<th> Unit    </th>\n".
      "<th> Qty     </th>\n".
      "<th> WHS     </th>\n".
      "<th> Price   </th>\n".
      "<th> #       </th>\n".
      "<th> DISC%   </th>\n".
      "<th> DISC    </th>\n".
      "<th> NET     </th>\n";

for($iRow = 0; $iRow < $_SESSION["init_num"]; $iRow++){

  echo  "<tr>\n".

        "<td> ".($iRow+1)." </td>\n".

        "<td> ".$CHtml->formInput("modelEnt[".$iRow."]",
                                  $_POST["modelEnt"][$iRow],
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("cvtEnt[".$iRow."]",
                                  $_POST["cvtEnt"][$iRow],
                                  $Misc->stdProperties().
                                  $Misc->stdStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("cvtQtyEnt[".$iRow."]",
                                  $_POST["cvtQtyEnt"][$iRow],
                                  $Misc->stdProperties().
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("unitEnt[".$iRow."]",
                                  $_POST["unitEnt"][$iRow],
                                  $Misc->stdStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("qtyEnt[".$iRow."]",
                                  $_POST["qtyEnt"][$iRow],
                                  $Misc->stdNumStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("whsEnt[".$iRow."]",
                                  $_POST["whsEnt"][$iRow],
                                  $Misc->stdNumStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("priceEnt[".$iRow."]",
                                  $_POST["priceEnt"][$iRow],
                                  $Misc->stdNumStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("hrzTotEnt[".$iRow."]",
                                  $_POST["hrzTotEnt"][$iRow],
                                  $Misc->stdNumStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("discPctgEnt[".$iRow."]",
                                  $_POST["discPctgEnt"][$iRow],
                                  $Misc->stdNumStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("discEnt[".$iRow."]",
                                  $_POST["discEnt"][$iRow],
                                  $Misc->stdNumStyle(5).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

        "<td> ".$CHtml->formInput("netEnt[".$iRow."]",
                                  $_POST["netEnt"][$iRow],
                                  $Misc->stdNumStyle(16).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".
      "</tr>\n";
}

echo  "<tr>\n".

        "<td colspan='3'><b> TOTAL </b></td>\n".

        "<td> ".$CHtml->formHidden("totCvtQtyEnt",
                                  $_POST["totCvtQtyEnt"],
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td>  </td>\n".

        "<td> ".$CHtml->formHidden("totQtyEnt",
                                  $_POST["totQtyEnt"],
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td colspan='2'> </td>\n". //blank

        "<td> ".$CHtml->formInput("totHrzTotEnt",
                                  $_POST["totHrzTotEnt"],
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td> </td>\n". //blank

        "<td> ".$CHtml->formInput("totDiscEnt",
                                  $_POST["totDiscEnt"],
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)."</td>\n".

        "<td> ".$CHtml->formInput("totNetEnt",
                                  $_POST["totNetEnt"],
                                  $Misc->stdNumStyle(16).
                                  _MODE_READONLY)."</td>\n".

      "</tr>\n";

echo  "<tr>\n".

        "<td align='right' ".$CHtml->rowColSpan( 1, 9)."><b>Disc% </b></td>\n".

        "<td> ".$CHtml->formInput("gDiscPctg",
                                  $_POST["gDiscPctg"],
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td><b>Disc  </b></td>\n".

        "<td> ".$CHtml->formInput("totGDisc",
                                  $_POST["totGDisc"],
                                  $Misc->stdNumStyle(16).
                                  _MODE_READONLY)." </td>\n".

      "</tr>\n".
      "<tr>\n".

        "<td align='right' ".$CHtml->rowColSpan( 1, 11)."><b>Amount  </b></td>\n".

        "<td> ".$CHtml->formInput("totAmount",
                                  $_POST["totAmount"],
                                  $Misc->stdNumStyle(16).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

      "</tr>\n".
      "<tr>\n".

        "<td align='right' ".$CHtml->rowColSpan( 1, 9)."><b>Tax%  </b></td>\n".

        "<td> ".$CHtml->formInput("totTaxPctg",
                                  $_POST["totTaxPctg"],
                                  $Misc->stdNumStyle(5).
                                  _MODE_READONLY)." </td>\n".

        "<td><b>Tax   </b></td>\n".

        "<td> ".$CHtml->formInput("totTax",
                                  $_POST["totTax"],
                                  $Misc->stdNumStyle(16).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

      "</tr>\n".
      "<tr>\n".

        "<td align='right' ".$CHtml->rowColSpan( 1, 11)."><b>Expense  </b></td>\n".

        "<td> ".$CHtml->formInput("totExpense",
                                  $_POST["totExpense"],
                                  $Misc->stdNumStyle(16).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

      "</tr>\n".
      "<tr>\n".

        "<td align='right' ".$CHtml->rowColSpan( 1, 11)."><b>Prepaid  </b></td>\n".

        "<td> ".$CHtml->formInput("totPrepaid",
                                  $_POST["totPrepaid"],
                                  $Misc->stdNumStyle(16).
                                  $Misc->stdProperties().
                                  _MODE_READONLY)." </td>\n".

      "</tr>\n".
      "<tr>\n".

        "<td align='right' ".$CHtml->rowColSpan( 1, 11)."><b>Payable  </b></td>\n".

        "<td> ".$CHtml->formInput("totPayable",
                                  $_POST["totPayable"],
                                  $Misc->stdNumStyle(16).
                                  _MODE_READONLY)." </td>\n".

      "</tr>\n";

echo  "</table>\n".
      "<br/>\n";

echo 	$CHtml->formInputButton("Save",
                              "confirm",
                              "Confirm",
                              $stlButton).

			$CHtml->formInputButton("Back",
                              "back",
                              "Back",
                              $stlButton).

  		"</form>	\n";

?>